package com.yiyi.credit.manage.abutment.common.enums;

public enum AppIdEnum {

    GXJRGLXT("gxjrglxt","gxjrglxt20180523"),
    YYJFTZHTFK("yyjftzhtfk","yyjftzhtfk20180705");

    private final String code;
    private final String privateKey;

    AppIdEnum(String code, String privateKey)
    {
        this.code = code;
        this.privateKey = privateKey;
    }

    public String getCode()
    {
        return code;
    }

    public String getPrivateKey()
    {
        return privateKey;
    }

    public static boolean isAppIdCode(String code)
    {
        for (AppIdEnum s : AppIdEnum.values())
        {
            if (s.getCode().equals(code))
            {
                return true;
            }
        }
        return false;
    }
    /**
     * 根据编码获取信息
     * @param code
     * @return
     */
    public static String getPrivateKeyByCode(String code)
    {
        for (AppIdEnum v : AppIdEnum.values())
        {
            if (v.getCode().equals(code))
            {
                return v.getPrivateKey();
            }
        }
        return null;
    }
}
